Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite with JuliaSyntax #870

Merged
merged 190 commits into from
Oct 16, 2024
Merged

Rewrite with JuliaSyntax #870

merged 190 commits into from
Oct 16, 2024

Conversation

domluna
Copy link
Owner

@domluna domluna commented Sep 10, 2024

This now passes all tests. This bumps the version up to v2.0.0 since, well, it is a complete rewrite and there are some breaking changes.

contintuation of #848

fixes

#767
#867
#862
#774
#241
#565
#876

CI to 1.10+

1.10 is the new LTS so we're dropping CI for earlier versions.

Whitespace for Operator Expressions (e.g., a + b) (BREAKING)

Formatting is now based on the source code, meaning a+b will remain as a+b, while expressions with spaces will be formatted as a + b (e.g., a +b becomes a + b). This change provides users with greater flexibility in formatting. Previously, almost all expressions were separated by a single whitespace.

Options related to whitespace around operators will function the same as before.

This change should have minimal impact on previously formatted code.

Semicolons (BREAKING)

We now track all semicolons to ensure they are always placed where present in the original code.

Multiline Comments (BREAKING)

Multiline comments, previously treated as inline comments or disregarded, are now preserved in their original form.

short_circuit_to_if Fix

This feature has been corrected. When a short circuit is the final expression, it will now be properly evaluated and converted to its full version. For example:

function foo(a, b)
    a || return "bar"

    "hello"

    b && return "ooo"
end

Now transforms to:

function foo(a, b)
    if !a
        return "bar"
    end

    "hello"

    if b
        return "ooo"
    else
        false
    end
end

Previously, the last expression would have been incorrectly transformed to just if b return "ooo" end, omitting the else clause.

@domluna domluna merged commit 2242a32 into master Oct 16, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant